<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/common/common.jsp" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <style type="text/css">
	BODY,TD {FONT-FAMILY: "宋体"; FONT-SIZE: 10pt;line-height: 15px} 
	</style>
    <title>show applydept</title>
    <script type="text/javascript">
    	function addFlowaudit(field) {
    		var result = field.attributes['result'].nodeValue;
    		var def = document.getElementById('result_def');
    		def.value = result;
    		var branch = document.getElementById('dictbranch');
    		if(branch.value == "Y"){
    			var remark = document.getElementById('remark');
    			var branchno = document.getElementById('branchno');
    			
    			var res = field.attributes['branchno'].nodeValue;
    			var remark_branch = document.getElementById('remark_' + res);
    			
    			remark.value = remark_branch.value;
    			branchno.value = res;
    		}
    		document.getElementById('addFlowaudithistory').submit();
    	}
    </script>
  </head>
  <body bgcolor="#ccddee" link="#000066" vlink="#0066FF" alink="#99FF00">
    <br>
		<h3>查看出库单</h3>
		<fieldset><legend>基本信息</legend>
		<table width="100%" border=1 align="center" cellpadding="0" cellspacing="0" bgcolor="#ccddee" ><tr>
			<td width="200">流程编号：${outputdept.outputno}</td>
			<td >发起机构：${outputdept.departmentByDeptcode.deptcaption}</td>
			<td >目的机构：${outputdept.departmentByDepartmentDeptcode.deptcaption}</td>
		</tr>
		<tr>
			<td width="200">主卡类型:${outputdept.cardmaintype.cardmaintypename}</td>
			<td >卡单位：${outputdept.datadictByUnit.name}</td>
			<td >流程约定时限: ${outputdept.limitday}</td>
		</tr>
		<tr>
			<td width="200">发起人: ${outputdept.personnel.loginname}</td>
			<td >优先级别:${outputdept.datadictByPri.name}</td>
			<td >备注:${outputdept.remark}</td>
		</tr></table>
		</fieldset>
		<s:form method="post" namespace="/workflow" theme="simple" action="addFlowaudithistory" >
		<table width="100%" border="0">
		<tr>
			<td width="50">
				<input type="button" value="添加子项" onclick="location.href='goAddOutputdeptdetail.action?outputno=${outputdept.outputno}'">
			</td>
			<td width="50">
				<input type="button" value="查看出库单列表" onclick="location.href='findAllOutputdept.action'">
			</td>
			<td width="50">
				<input type="button" value="查看审核记录" onclick="location.href='findAllFlowaudithistoryWithParam.action?flowflag=84&flowno=${outputdept.outputno}'">
			</td>
			<c:if test="${outputdept.datadictByBranch.name == 'N' && outputdept.datadictByStatus.name != '作废' && outputdept.datadictByStatus.name != '完成'}">
			<td width="50">
				<s:textfield name="flowaudithistory.remark" theme="simple" ></s:textfield>
			</td>
			<td width="50">
				<input type="button" value="通过" result="T" onclick="addFlowaudit(this)">
				<input type="button" value="拒绝" result="F" onclick="addFlowaudit(this)">
			</td>
			</c:if>
			<c:if test="${outputdept.datadictByBranch.name != 'N' }">
				<input type="hidden" id="remark" name="flowaudithistory.remark" value="">
				<input type="hidden" id="branchno" name="branchno" value="">
			</c:if>
			<td >
				<input type="hidden" name="flowno" value="${outputdept.outputno}">
			</td>
			<td >
				<input type="hidden" name="flowflag" value="84">
			</td>
			<td >
				<input type="hidden" id="dictbranch" name="dictbranch" value="${outputdept.datadictByBranch.name}">
			</td>
			<td >
				<input type="hidden" name="result" value="F" id="result_def">
			</td>
		</tr>
		</table>
		</s:form>
		<fieldset><legend>子菜单</legend>
		<table width="100%" border=1 align="center" cellpadding="0" cellspacing="0" bgcolor="#ccddee" >
				<tr>
			        <td align="center" width="20%">编号</td>
			        <td align="center">卡类型</td>
			        <td align="center">数量</td>
			        <td align="center">金额</td>
			        <td align="center">操作</td>
      			</tr>
      			<s:iterator value="pm.datas" status="rowstatus" var="outputdeptdetail">
      				<tr <s:if test="#rowstatus.odd == true">bgcolor="white"</s:if>>
				        <td align="center">
				        	<s:property value="outdetailno"/>
				        </td>
				        <td align="center">
				        	<s:property value="#outputdeptdetail.cardsubtype.cardsubtypename"/>
				        </td>
				        <td align="center">
				        	<s:property value="totalsum"/>
				        </td>
				        <td align="center">
				        	<s:property value="totalmoney"/>
				        </td>
			        	<td align="center">
			        		<c:if test="${outputdept.datadictByBranch.name != 'N' }">
			        		<input type="text" id="remark_<s:property value="outdetailno"/>" name="remark_<s:property value="outdetailno"/>" >
			        		<input type="button" value="通过" result="T" resource=<s:property value="outdetailno"/> onclick="addFlowaudit(this)">
							<input type="button" value="拒绝" result="F" resource=<s:property value="outdetailno"/> onclick="addFlowaudit(this)">
							</c:if>
							<s:if test="#outputdeptdetail.outputdept.datadictByStatus.name == '作废' || #outputdeptdetail.outputdept.datadictByStatus.name == '保存' ">
			        		<a href='delOutputdeptdetail.action?outputno=${outputdept.outputno}&outdetailno=<s:property value="outdetailno"/>'>删除</a>
			        		</s:if>
				        	<a href="outputcard.action?outdetailno=<s:property value="outdetailno"/>">选卡</a>
			        		<a href="getOutputdeptdetailForUpdate.action?outdetailno=<s:property value="outdetailno"/>">修改</a>
			        	</td>
			        </tr>
				</s:iterator>
				<tr>
					<td colspan="8" align="center">
				<pg:pager url="${url}" items="${pm.total }" export="offset,currentPageNumber=pageNumber">
					<pg:first>
						<a href="${pageUrl }">首页</a>
					</pg:first>
					<pg:prev>
						<a href="${pageUrl }">前页</a>
					</pg:prev>
					<pg:pages>
						<c:choose>
							<c:when test="${currentPageNumber eq pageNumber}">
								<font color="red">${pageNumber }</font>
							</c:when>
							<c:otherwise>
								<a href="${pageUrl }">${pageNumber }</a>
							</c:otherwise>
						</c:choose>
					</pg:pages>
					<pg:next>
						<a href="${pageUrl }">后页</a>
					</pg:next>
					<pg:last>
						<a href="${pageUrl }">尾页</a>
					</pg:last>
				</pg:pager>
					</td>
				</tr>
      		</table>
		</fieldset>
		<br>
</body>
</html>
